package org.amphiprion.gameengine;

import java.util.ArrayList;

import org.amphiprion.gameengine.util.Vector4;

public class ScreenProperty {
	public static final Vector4 NO_CLIPPING = new Vector4(-1, -1, -1, -1);
	public float screenScaleX = 1.0f;
	public float screenScaleY = 1.0f;
	public float screenRotation;
	public float screenOffsetX;
	public float screenOffsetY;
	public float realWidth = 800.0f;
	public float realHeight = 480.0f;
	public float referenceWidth = 1280f;
	public float referenceHeight = 768;

	public float maskColorRed = 1;
	public float maskColorGreen = 1;
	public float maskColorBlue = 1;
	public float maskColorAlpha = 1;

	public float[] projectionMatrixFor2D;
	public float[] projectionMatrixFor3D;
	public float[] viewMatrixFor3D;
	public Camera camera;

	public int deviceAngle;

	private ArrayList<Vector4> clippings = new ArrayList<Vector4>();

	public Vector4 getClipping() {
		if (clippings.size() > 0) {
			return clippings.get(0);
		} else {
			return null;
		}
	}

	public void pushClipping(float topX, float topY, float with, float height) {
		clippings.add(0, new Vector4(topX, topY, with, height));
	}

	/**
	 * @param clipping
	 *            Vector4(topX, topY, with, height)
	 */
	public void pushClipping(Vector4 clipping) {
		clippings.add(0, clipping);
	}

	public void popClipping() {
		clippings.remove(0);
	}
}
